import 'package:flutter/material.dart';
import 'dart:js_util';
import 'package:v10/bs.dart';
import 'package:v10/chart2.dart';
import 'package:v10/canvas2.dart';
import 'package:v10/offset.dart';

void main() => runApp(MyApp());

class MyApp extends StatelessWidget {
  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      debugShowCheckedModeBanner: false,
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: MyHomePage(title: 'Flutter Demo Home2'),
    );
  }
}

class MyHomePage extends StatefulWidget {
  MyHomePage({Key key, this.title}) : super(key: key);
  final String title;

  @override
  _MyHomePageState createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  int _counter = 0;

  void _incrementCounter() {
    setState(() {
      _counter++;
    });
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text(widget.title),
      ),
      body: Column(
        mainAxisAlignment: MainAxisAlignment.start,
        crossAxisAlignment: CrossAxisAlignment.start,
        children: <Widget>[
          MaterialButton(
            onPressed: () {
              Navigator.push(context,
                  new MaterialPageRoute(builder: (BuildContext context) {
                return new BtAppMain();
              }));
            },
            child: Text(
              '底部导航',
            ),
          ),
          MaterialButton(
            color: Colors.blueGrey,
            shape: RoundedRectangleBorder(
                borderRadius: BorderRadius.all(Radius.circular(5))),
            onPressed: () {
              Navigator.push(context, new MaterialPageRoute(builder: (context) {
                return new LineChartSample();
              }));
            },
            child: DecoratedBox(
                decoration: BoxDecoration(color: Colors.lightGreen),
                child: Text('图表')),
          ),
          MaterialButton(
            onPressed: () {
              Navigator.push(context,
                  new MaterialPageRoute(builder: (BuildContext context) {
                return Canvas2();
              }));
            },
            child: Text(
              'Cancas绘制',
            ),
          ),
          MaterialButton(
            onPressed: () {
              Navigator.push(context,
                  new MaterialPageRoute(builder: (BuildContext context) {
                return HideAndShowPage();
              }));
            },
            child: Text(
              'widget显示与隐藏',
            ),
          ),
        ],
      ),
      floatingActionButton: FloatingActionButton(
        onPressed: _incrementCounter,
        tooltip: 'Increment',
        child: Text(
          '$_counter',
          style: Theme.of(context).textTheme.display1,
        ),
      ), // This trailing comma makes auto-formatting nicer for build methods.
    );
  }
}
